package org.hzandyy.framework.liteflow.flow;

import com.yomahub.liteflow.annotation.LiteflowComponent;
import com.yomahub.liteflow.core.NodeBreakComponent;
import lombok.extern.slf4j.Slf4j;

/**
 * @author hz
 * @since 2023/12/8 10:19
 */
@LiteflowComponent("node_break")
@Slf4j
public class NodeBreakCmp extends NodeBreakComponent {

    @Override
    public boolean processBreak() throws Exception {
        boolean result = false;

        Integer index = getLoopIndex();
        if (null != index && 2 == index) {
            result = true;
            log.info("loop break");
        }

        return result;
    }

}
